(function (doc, win) {
    var docEl = win.document.documentElement;
    var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';

    var refreshRem = function () {
        var clientWidth = win.innerWidth || doc.documentElement.clientWidth || doc.body.clientWidth;
        if (!clientWidth) return;
        var fz;
        var width = clientWidth;
        // 方案一
        // fz = 37.5 * width / 375;
        // 方案二
        if (innerWidth <= 320) {
            fz= 32;
        } else if (innerWidth > 320 && innerWidth <= 480) {
            fz = 37.5 * width / 375;
        } else {
            fz= 48;
        }
        docEl.style.fontSize = fz + 'px';
    };

    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, refreshRem, false);
    doc.addEventListener('DOMContentLoaded', refreshRem, false);
    refreshRem();
})(document, window);


